1 <? if(!session_id()) session_start(); ?>
2 <? require(
"../system/model/config.php") ?>
3 <? require(
"../system/model/common_start.php") ?>
4 <?

5 if
(isset($_POST['butSub'])) {
6  
7     $user = isset($_POST[
'txtUser']) && is_string($_POST['txtUser']) ? mysql_real_escape_string($_POST['txtUser']) : null;
8     $pass = isset($_POST[
'txtPwd']) && is_string($_POST['txtPwd']) && is_string($_POST['txtPwd']) ? mysql_real_escape_string($_POST['txtPwd']) : null;
9     $passa = ( md5(md5(md5( md5(md5(md5( mysql_real_escape_string($pass))))))));
10     $sql =
"select * from user_nhanvien where user='".$user."' and pass='".$passa."' and level='1' limit 1";
11     
12     
if (mysql_num_rows(mysql_query($sql,$con))>0) {
13           $log=$user;
14   
// session_register("user");
15   $_SESSION[
'user']=$user;
16   echo
"<script>window.location='index.php'</script>";
17
18     }
19     
else
20     {
21         $err=
"Username / Password không &#273;úng";
22     }
23 }
24 ?>
25 <html>
26
27 <head>
28 <meta http-equiv=
"Content-Type" content="text/html; charset=utf-8">
29 <LINK href=
"style.css" rel="stylesheet" type="text/css">
30 <title>Đăng Nhập</title>
31 </head>
32
33 <body topmargin=
"0" leftmargin="0" rightmargin="0" bottommargin="0">
34
35 <table border=
"0" width="100%" cellspacing="0" cellpadding="0" id="table1">
36     <tr>
37         <td valign=
"top">
38 <!-- Start Content -->
39
40
41 <body>
42
43 <form method=
"post" name="FormLoaiSP">
44 <div align=
"center">
45 &nbsp;<p>&nbsp;</p>
46 <p>&nbsp;</p>
47 <p>&nbsp;</p>
48 <p>&nbsp;</p>
49 <table border=
"1" style="border-collapse: collapse" width="161" id="table20" cellpadding="0" height="100%" bordercolor="#006AAA">
50   <tr>
51     <td width=
"100%" class="title" height="25">
52     <p align=
"center" class="title">Admin</td>
53   </tr>
54   <tr>
55     <td width=
"100%" align="center">
56     <table border=
"0" cellpadding="4" bordercolor="#111111" width="267" id="AutoNumber2" cellspacing="0">
57 <?

58 if
($err!='')
59 {
60     echo
'<tr><td colspan="2" align="center" width="100%" height="25" class="err">'.$err.'</td></tr>';
61 }
62 ?>
63       <tr>
64         <td width=
"32%" class="smallfont">
65         Username</td>
66         <td width=
"57%" class="smallfont">
67         <font face=
"Script">
68         <input type=
"text" name="txtUser" size="20" ></font></td>
69       </tr>
70       <tr>
71         <td width=
"32%" class="smallfont">
72         Password</td>
73         <td width=
"57%" class="smallfont">
74         <font face=
"Script">
75         <input type=
"password" name="txtPwd" size="20"></font></td>
76       </tr>
77       <tr>
78         <td width=
"94%" class="smallfont" colspan="2">
79         <p align=
"center">&nbsp;<font face="Script"><INPUT TYPE="submit" name="butSub" value="Login"></font></td>
80       </tr>
81     </table>
82     </td>
83   </tr>
84   </table>
85 </div>
86 </form>
87
88
89 <!-- End Content -->
90         </td>
91         <td width=
"0%" valign="top">
92 <!-- Start Right -->
93 <? include(
"admin_panel_right.php"); ?>
94 <!-- End Right -->
95         </td>
96     </tr>
97     </table>
98
99 </body>
100
101 </html>
102 <? require(
"../system/model/common_end.php") ?>



Full source code website bán hàng thương mại điện tử gần giống shopee 468.810 lượt xem

Gõ tìm kiếm nhanh...